# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-game-libretro-frodo
pkgver=0.0.1.5
_realname=Matrix
pkgrel=0
pkgdesc="Commodore - C64 (Frodo) game addon for Kodi"
options="!check" # no test suite
url="https://github.com/kodi-game/game.libretro.frodo"
arch="x86 x86_64 aarch64 armv7" # kodi
license="GPL-2.0-only"
makedepends="cmake kodi-dev"
depends="kodi-game-libretro libretro-frodo"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/kodi-game/game.libretro.frodo/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/game.libretro.frodo-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
	rm -r "$pkgdir"/usr/lib/kodi/addons/game.libretro.frodo/game.libretro.frodo.so
	ln -s /usr/lib/libretro/frodo_libretro.so \
		"$pkgdir"/usr/lib/kodi/addons/game.libretro.frodo/game.libretro.frodo.so
}

sha512sums="3ce19c82ad0021c3f27d91dd2b3ab4fe152091e8faca8a1bc71878ffe15a936529e86b691b0dcf8348d769580a604be163ad35d0f6b1b5d8a978b994ac144db6  kodi-game-libretro-frodo-0.0.1.5-Matrix.tar.gz"
